package ru.spbau.design.snmp.android.viewer.utils;

import java.util.List;

public class ReplaceableListItem<T> {
	
	public ReplaceableListItem(int itemIndex, List<T> itemStorage) {
		this.itemIndex = itemIndex;
		this.itemStorage = itemStorage;
	}
	
	public T getItem() {
		return itemStorage.get(itemIndex);
	}
	
	public void replaceItem(T item) {
		itemStorage.set(itemIndex, item);
	}
	
	private final int itemIndex;
	private final List<T> itemStorage;
}
